package org.elephas.webapp.frontend.component.links;

import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.panel.Panel;
import org.elephas.webapp.application.ElephasSession;
import org.elephas.webapp.frontend.page.RegisterPage;

public class RegisterLinkPanel extends Panel {
	private static final long serialVersionUID = 1L;

	public RegisterLinkPanel(String id) {
		super(id);
		// final SimpleModal registerModal = new SimpleModal("registerModal") {
		// private static final long serialVersionUID = 1L;
		//
		// @Override
		// protected Panel newPanel(String id) {
		// return new RegisterFormPanel(id);
		// }
		// };
		// add(registerModal);
		// add(new AjaxLink("registerLink") {
		// private static final long serialVersionUID = 1L;
		//
		// @Override
		// public void onClick(AjaxRequestTarget target) {
		// registerModal.show(target);
		// }
		//
		// });
		add(new BookmarkablePageLink("registerLink", RegisterPage.class));
	}

	@Override
	public boolean isVisible() {
		return !ElephasSession.get().isSignedIn();
	}
}
